package cn.edu.zut.hhr.controller;

import cn.edu.zut.hhr.entity.Dept;
import cn.edu.zut.hhr.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;


@Controller
@RequestMapping("/feign/dept")

public class DeptController{

    @Autowired
    DeptService deptService;

    @GetMapping("/{id}")
    @ResponseBody
    public Dept getById(@PathVariable("id") long id){
        return deptService.getById(id);
    }

}
